
export default `
import zipfile from '@feidao/web/atom/nodejs/zip/zip';
import { Workbook } from 'exceljs';
import { ICommonParams } from '@feidao/service/interfaces';

export default async function atom(msg: ICommonParams, action_id: string, session_id: string, spaceid: string) {

	const wb = new Workbook();
	const dict1 = wb.addWorksheet('dict1');
	dict1.columns = [
		{ header: '教学班编号', key: 'teaching_class_id', width: 20 },
		{ header: '教学班名称', key: 'teaching_class', width: 20 },//B
		{ header: '学号', key: 'student_id', width: 20 },//C
		{ header: '姓名', key: 'student_name', width: 20 },//D
		{ header: '平时成绩', key: 'ordinary_performance', width: 20 },// E
	];

	const buff = await wb.xlsx.writeBuffer();
	const content = await zipfile({ file: buff as Buffer, path: './文件名称.xlsx' });
	return {
		attachment: '压缩包名称.zip',
		buff: content,
		content_type: 'application/octet-stream'
	};
}
`;
